/*-----------------------------------------------------------------------------
	The contents of this file are subject to the Mozilla Public License
	Version 1.1 (the "License"); you may not use this file except in
	compliance with the License.You may obtain a copy of the License at
	http://www.mozilla.org/MPL/MPL-1.1.html
	
	Software distributed under the License is distributed on an "AS IS"
	basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
	License for the specific language governing rights and limitations
	under the License.
	
	The Original Code is Fever Framework code.
	
	The Initial Developer of the Original Code is Romain Ecarnot.
	Portions created by Initial Developer are Copyright (C) 2006
	the Initial Developer. All Rights Reserved.
	
	Contributor(s):
	
	Unless required by applicable law or agreed to in writing, software
	distributed under the License is distributed on an "AS IS" BASIS,
	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	See the License for the specific language governing permissions and
	limitations under the License.
-----------------------------------------------------------------------------*/

import com.bourre.structures.Range;

/**
 * Defines range for all 3 HSL components.
 * 
 * <p>Default ranges are predefined, possible are :
 * <ul>
 *   <li>{@link #PAINTSHOPPRO}</li>
 *   <li>{@link #WINDOWS}</li>
 * </ul>
 * 
 * @see fever.structures.color.HSL
 * 
 * @author Romain Ecarnot
 */
class fever.structures.color.HSLRange
{
	//-------------------------------------------------------------------------
	// Constants definition
	//-------------------------------------------------------------------------
	
	/** HSL Range according PaintShop Pro environment. */
	public static var PAINTSHOPPRO : HSLRange = new HSLRange( new Range(0,255), new Range(0,255), new Range(0,255) );
	
	/** HSL Range according Windows environment. */
	public static var WINDOWS : HSLRange = new HSLRange( new Range(0,240), new Range(0,240), new Range(0,240) );
	
	
	//-------------------------------------------------------------------------
	// Private properties
	//-------------------------------------------------------------------------
		
	private var _hRange : Range;	private var _sRange : Range;	private var _lRange : Range;
	
	
	//-------------------------------------------------------------------------
	// Public Properties
	//-------------------------------------------------------------------------
	
	/** Hue range. */
	public function get hue() : Range  { return _hRange; }
	
	/** Saturation range. */	public function get saturation() : Range  { return _sRange; }
	
	/** Luminance range. */	public function get luminance() : Range  { return _lRange; }
	
		
	//-------------------------------------------------------------------------
	// Public API
	//-------------------------------------------------------------------------
	
	/**
	 * Constructor.
	 */
	public function HSLRange( h : Range, s : Range, l : Range)
	{
		_hRange = (h) ? h : new Range(0, 240);
		_sRange = (s) ? s : new Range(0, 240);
		_lRange = (l) ? l : new Range(0, 240);
	}

}